# *-* coding: utf-8 *-*
"""
@author: Hekang Xu (E-mail:1092181938@qq.com)
"""


def out_rate(
        percent_bool: bool,
        total_num: int,
        now_num: int,
        per_show: int):
    """
    统一进度输出
    :param percent_bool: 是否使用百分比输出还是数字输出
    :param total_num:总数
    :param now_num:现在的计数
    :param per_show:每多少间隔输出一次
    :return:输出控制台提示
    """
    if percent_bool:
        if now_num * 100 % (per_show * total_num) == 0:
            print("进度：", now_num * 100.0 / total_num, '%')
        else:
            return False
    else:
        if now_num % per_show == 0:
            print("进度：", now_num, '/', total_num)
